package top.jiangqiang.qyblog.core.domain.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Data
@Accessors(chain = true)
@Schema(name = "文章新增或编辑", description = "")
public class ArticleSettingDto implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "文章ID")
    @NotNull(message = "文章ID不能为空")
    private Long id;

    @Schema(description = "文章标题")
    @NotBlank(message = "文章标题不能为空")
    private String title;

    @Schema(description = "文章概要，用于文章列表处显示")
    private String abstractContent;

    @Schema(description = "文章别名，用于拼接该文章详情页的访问地址")
    @NotBlank(message = "文章别名不能为空")
    private String alias;

    @Schema(description = "文章封面图片地址")
    private String coverUrl;

    @Schema(description = "文章额外配置，例如附件列表")
    private Map<String, Object> metadata;

    @Schema(description = "文章所属标签名称列表")
    private List<String> tagNames;

    @Schema(description = "文章所属分类名称列表")
    private List<String> categoryNames;

    @Schema(description = "文章发布时间", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publishTime;

    @Schema(description = "文章排序")
    private Integer sort = 0;

    @Schema(description = "文章状态，1：未发布 2：已发布", type = "integer")
    private Integer status;

}
